<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: pameldtedetaljer.php 6 2005-07-11 23:14:47Z say $
 */
 
include("../db.php");
include("auth.php");
include("top.php");
?>
<h1>Detaljer om p�melding</h1>
<?
$sql="SELECT *, DATE_FORMAT(tstamp, '%d.%m.%Y %H:%i') AS tid FROM deltakere WHERE ID=".$_REQUEST['id'];
$deltakere=mysql_query($sql);
if (! mysql_num_rows($deltakere)) die("Deltakeren finnes ikke");

$deltaker=mysql_fetch_assoc($deltakere);
?>
<table border=1>
<tr>
<td><b>ID</b></td>
<td><?=$deltaker['ID']?></td>
</tr>
<tr>
<td><b>Navn</b></td>
<td><?=$deltaker['Navn']?></td>
</tr>
<tr>
<td><b>F�dselsdato</b></td>
<td><?=$deltaker['Fodselsdato']?></td>
</tr>
<tr>
<td><b>Adresse</b></td>
<td><?=$deltaker['Adresse']?></td>
</tr>
<tr>
<td><b>Postnr./sted</b></td>
<td><?=$deltaker['Postnrsted']?></td>
</tr>
<tr>
<td><b>E-post</b></td>
<td><?=$deltaker['Epost']?></td>
</tr>
<tr>
<td><b>Telefon</b></td>
<td><?=$deltaker['Telefon']?></td>
</tr>
<tr>
<td><b>P�r�rende</b></td>
<td><?=$deltaker['Parorende']?></td>
</tr>
<tr>
<td><b>P�r�rende telefon</b></td>
<td><?=$deltaker['Parorende_tlf']?></td>
</tr>
<tr>
<td><b>Erfaring</b></td>
<td><?=nl2br($deltaker['Erfaring'])?></td>
</tr>
<tr>
<td><b>Brukernavn</b></td>
<td><?=$deltaker['Brukernavn']?></td>
</tr>
<tr>
<td><b>Registrert</b></td>
<td><?=$deltaker['tid']?></td>
</tr>
<tr>
<td><b>Vil spille</b></td>
<td><?
	$sql="SELECT * FROM karakteristikker LEFT JOIN karakteristikklinje ON karakteristikklinje.KarakteristikkID=karakteristikker.ID WHERE DeltakerID=".$deltaker['ID'];
	$karakteristikker=mysql_query($sql) or die(mysql_error());
	while ($karakteristikk=mysql_fetch_assoc($karakteristikker))
		echo $karakteristikk['Karakteristikk'].", ";
	?></td>
</tr>
<tr>
<td><b>Egenskaper</b></td>
<td><?
	$sql="SELECT * FROM egenskaper LEFT JOIN egenskaplinje ON egenskaplinje.EgenskapID=egenskaper.ID WHERE DeltakerID=".$deltaker['ID'];
	$karakteristikker=mysql_query($sql) or die(mysql_error());
	while ($karakteristikk=mysql_fetch_assoc($karakteristikker))
		echo $karakteristikk['Egenskap'].", ";
	?></td>
</tr>
<tr>
<td><b>Status</b></td>
<td>S�knaden er <? if ($deltaker['Godkjent'] > 0) echo "innvilget"; elseif ($deltaker['Godkjent'] < 0) echo "avsl�tt"; elseif ($deltaker['Godkjent'] == 0) echo "ikke tatt stilling til";?>.</td>
</tr>
<tr>
<td><b>Actionz</b></td>
<td><form method="post" action="pameldte.php">
	<input type="hidden" name="process" value="true">
	<input type="hidden" name="id" value="<?=$deltaker['ID']?>">
	<?
	if ($deltaker['Godkjent'] != 1) {
		?>
		<input type="submit" name="action" value="Innvilg"><br>
		<?
	}
	if ($deltaker['Godkjent'] != -1) {
		?>
		<input type="submit" name="action" value="Avsl�"><br>
		<?
	}
	if ($deltaker['Godkjent'] != 0) {
		?>
		<input type="submit" name="action" value="Gi ny behandling"><br>
		<?
	}
	?>
	<br>
	<input type="submit" name="action" value="Slett"><br>
	<p>
	</form>
	<form method="post" action="pameldte.php">
	<input type="hidden" name="process" value="true">
	<input type="hidden" name="id" value="<?=$deltaker['ID']?>">
	Nytt passord:<br>
	<input type="password" name="passord"><br>
	<input type="submit" name="action" value="Endre passord">
	</form></td>
</tr>
</table>

<?
include("bottom.php");
?>
